cmake_minimum_required(VERSION 2.8.12)

project(log)

add_library(log STATIC
    ${CMAKE_CURRENT_SOURCE_DIR}/color.h
    ${CMAKE_CURRENT_SOURCE_DIR}/kernel_list.h
    ${CMAKE_CURRENT_SOURCE_DIR}/liblog.c
    ${CMAKE_CURRENT_SOURCE_DIR}/liblog.h
    ${CMAKE_CURRENT_SOURCE_DIR}/libposix.c
    ${CMAKE_CURRENT_SOURCE_DIR}/libposix.h
)

set_target_properties(log PROPERTIES
  POSITION_INDEPENDENT_CODE ON
)

if( DEFINED ENV{SUNSCAN_ROOT} )
    message(STATUS "DEFINED SUNSCAN_ROOT:$ENV{SUNSCAN_ROOT}")
    set(LIBRARY_OUTPUT_PATH $ENV{SUNSCAN_ROOT}/bin)
else()
    message(STATUS "NOT defined SUNSCAN_ROOT")
    set(LIBRARY_OUTPUT_PATH $ENV{HOME}/SunScan/bin)
endif()
